<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.fick.hibernate.model.*"%>
<%@ page import="com.fick.hibernate.dao.*"%>
<%@ page import="java.util.ArrayList" %>
<%@ include file="../tld/tlds.jsp"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>视频管理</title>
<link href="images/jiahao.css" rel="stylesheet" type="text/css">
</head>
<script language="JavaScript" src="js/meihuaxue.js"></script>
		<script language="javaScript" src="js/prototype.js"></script>
		<script type="text/javascript" src="js/submit.js"></script>
         
		<script type="text/javascript">
		 function sa(channelid){
                iframe1.location = "treeVod.jsp?channelid="+channelid; 
              }  
		</script>
<body>

<%Admin admin=(Admin)request.getSession().getAttribute("admin"); %>
<table width="100%"  height="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="100%" align="center" valign="top" background="images/main_bj.gif" bgcolor="#FBFCFD"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="23" align="left" valign="middle" background="images/main_top.gif"><table border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="20" height="23">&nbsp;</td>
            <td width="400" height="23" align="left" valign="middle" class="ts_lmdh2">视频管理</td>
          </tr>
        </table></td>
      </tr>
    </table>
      <table width="98%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height="20"></td>
        </tr>
      </table>
      <table width="98%" height="450" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td width="21%" align="center" valign="top"><table width="98%" border="0" cellpadding="0" cellspacing="1" bgcolor="#D7DFE1">
            <tr>
              <td height="25" align="center" valign="middle" background="images/main_t_bj.gif" bgcolor="#FFFFFF" class="ts_lmdh">栏目选择</td>
            </tr>
            <tr>
              <td align="center" valign="top" bgcolor="#FFFFFF"><table width="98%" height="8" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td></td>
                </tr>
              </table>
                <table width="98%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td align="left" valign="top">
					<%
					if (admin.getRole().getId() == 3 || admin.getRole().getId() == 5 ) {
		%>
		<script language="JavaScript">
                     var tree = new MzTreeView("tree");
                     tree.setIconPath("<%=request.getContextPath()%>/admin/TreeView/"); //可用相对路
                     tree.nodes["0_1"] = "text:所有栏目;";
					 <%
					 List channellist=new ChannelDAO().findAll();
					 for(int i=0;i<channellist.size();i++)
					 {Channel channel=(Channel)channellist.get(i);

					 %> 
					  
					   tree.nodes["<%=channel.getFatherId()%>_<%=channel.getChannelId()%>"] = "text:<%=channel.getName().replaceAll("'","‘").replaceAll("\"","”")%>;method:sa('<%=channel.getChannelId()%>')";  
					 <%
					   }
					 %>
					 
				   tree.setTarget("MzMain");
				   document.write(tree.toString());    //亦可用 obj.innerHTML = tree.toString();
				 </script>
             <%}else{%>
                <script language="JavaScript">
                     var tree = new MzTreeView("tree");
                     tree.setIconPath("<%=request.getContextPath()%>/admin/TreeView/"); //可用相对路
                     tree.nodes["0_1"] = "text:栏目管理;";
					 <% List channellist=new ArrayList();
					 String hql="from AdminQx where admin.adminId='"+admin.getAdminId()+"'";
					 List qxlist=new AdminQxDAO().getSession().createQuery(hql).list();
					 for(int j=0;j<qxlist.size();j++)
					 {
						 AdminQx qx=(AdminQx)qxlist.get(j);
						 channellist.add(qx.getChannel());
					 }
					 for(int i=0;i<channellist.size();i++)
					 {Channel channel=(Channel)channellist.get(i);
					 %> 
					  
					   tree.nodes["1_<%=channel.getChannelId()%>"] = "text:<%=channel.getName().replaceAll("'","‘").replaceAll("\"","”")%>;method:sa('<%=channel.getChannelId()%>')";  
					 <%
					   }
					 %>
					 
				   tree.setTarget("MzMain");
				   document.write(tree.toString());    //亦可用 obj.innerHTML = tree.toString();
				 </script>
				 <%} %>
                    </td>
                  </tr>
                </table>
                <table width="98%" height="8" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td></td>
                  </tr>
                </table>
                </td>
            </tr>
          </table></td>
          <td width="79%" align="center" valign="top">
		  
		  
		  
		  
		  
		  
		  
		  
		  
		  
		  
		
		  <table width="98%" border="0" cellpadding="0" cellspacing="1" bgcolor="#D7DFE1">
            <tr>
              <td height="25" align="center" valign="middle" background="images/main_t_bj.gif" bgcolor="#FFFFFF" class="ts_lmdh">视频列表</td>
            </tr>
            <tr>
              <td align="center" valign="top" bgcolor="#FFFFFF"><table width="98%" height="8" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td></td>
                  </tr>
                </table>
                  <iframe src="treeVod.jsp" name="iframe1" id="iframe1" width="100%" height="450">
                  </iframe>
                  <table width="98%" height="22" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                      <td height="22"></td>
                    </tr>
                </table></td>
            </tr>
          </table>
		  
		  
		  
		  
		  
		  
		  
		  
		  
		  
		  
		  
		  </td>
        </tr>
      </table>
      <table width="98%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height="45" align="center" valign="middle">&nbsp;</td>
        </tr>
      </table></td>
  </tr>
</table>
</body>
</html>
